﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WebQQ2.DLL;

namespace QunRobot
{
    public partial class Form1 : Form
    {
        private Common com;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.txtUser.Text = "1497414463";
            this.txtPass.Text = "abcdefghij";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (txtUser.Text != "" && txtPass.Text != "")
            {
                Users user = new Users();
                user.UserName = Convert.ToInt32(txtUser.Text);
                user.Password = txtPass.Text;
                user.State = comboBox1.Text;
                user.OnLoneStatus = comboBox1.Text;

                com = new Common(user);

                System.Threading.Thread t = new System.Threading.Thread(delegate() { com.StarLogin(); });
                t.IsBackground = true;
                t.Start();

                this.Visible = false;
                notifyIcon1.Visible = true;
            }
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
            Application.Exit();
        }
    }
}
